<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Emulateur PROCSI:  Fichier source de /home/aboursie/workspace/emulator-procsi/src/main.c</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Généré par Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Recherche');
--></script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Emulateur PROCSI&#160;<span id="projectnumber">1</span></div>
   <div id="projectbrief">reproduction du fonctionnement de PROCSI en C</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Page&#160;principale</span></a></li>
      <li><a href="annotated.html"><span>Structures&#160;de&#160;données</span></a></li>
      <li class="current"><a href="files.html"><span>Fichiers</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Recherche" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Liste&#160;des&#160;fichiers</span></a></li>
      <li><a href="globals.html"><span>Portée&#160;globale</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">/home/aboursie/workspace/emulator-procsi/src/main.c</div>  </div>
</div>
<div class="contents">
<a href="main_8c.html">Aller à la documentation de ce fichier.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00002"></a>00002 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00003"></a>00003 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &quot;<a class="code" href="pvm_8h.html">pvm.h</a>&quot;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &quot;<a class="code" href="instructions_8h.html">instructions.h</a>&quot;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;<a class="code" href="parser_8h.html">parser.h</a>&quot;</span>
<a name="l00007"></a>00007 
<a name="l00016"></a><a class="code" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe">00016</a> <span class="keywordtype">int</span> <a class="code" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a>(<span class="keywordtype">void</span>) {
<a name="l00017"></a>00017 
<a name="l00018"></a>00018         printf(<span class="stringliteral">&quot;###### Initialisation de la machine virtuelle ######\n&quot;</span>);
<a name="l00019"></a>00019 
<a name="l00020"></a>00020         <a class="code" href="struct_p_v_m.html">PVM</a> *pvm = <a class="code" href="pvm_8c.html#a1b0875fb61cdafebccde8bebcb6d8f0f">newPVM</a>();
<a name="l00021"></a>00021 
<a name="l00022"></a>00022         printf(<span class="stringliteral">&quot;\n###### Programme de test des fonctionnalités de base : LOAD, ADD, SUB, STORE \nAvec les différents type d&#39;adressage  ######\n&quot;</span>);
<a name="l00023"></a>00023 
<a name="l00024"></a>00024         printf(<span class="stringliteral">&quot;\t --&gt;Chargement du programme\n&quot;</span>);
<a name="l00025"></a>00025 
<a name="l00026"></a>00026         <a class="code" href="parser_8c.html#a77e7225758aa19ce6f3e9d4be4e8c229">load_program</a>(<span class="stringliteral">&quot;test.procsi&quot;</span>, pvm);
<a name="l00027"></a>00027 
<a name="l00028"></a>00028         <span class="keywordtype">int</span> i =1;
<a name="l00029"></a>00029         <span class="keywordflow">do</span> {
<a name="l00030"></a>00030                 printf(<span class="stringliteral">&quot;\nÉxécution de l&#39;instruction n°%d\n&quot;</span>, i);
<a name="l00031"></a>00031                 i++;
<a name="l00032"></a>00032         } <span class="keywordflow">while</span>(<a class="code" href="pvm_8c.html#ade2f21f7767ed25174ef94e84548edbe">step</a>(pvm));
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 
<a name="l00035"></a>00035         printf(<span class="stringliteral">&quot;\n\nAppuyez sur une touche pour continuer.. \n&quot;</span>);
<a name="l00036"></a>00036         getchar();
<a name="l00037"></a>00037 
<a name="l00038"></a>00038         printf(<span class="stringliteral">&quot;\n\n###### Initialisation de la machine virtuelle ######\n&quot;</span>);
<a name="l00039"></a>00039 
<a name="l00040"></a>00040         pvm = <a class="code" href="pvm_8c.html#a1b0875fb61cdafebccde8bebcb6d8f0f">newPVM</a>();
<a name="l00041"></a>00041 
<a name="l00042"></a>00042         printf(<span class="stringliteral">&quot;\n###### Programme de test des fonctionnalités d&#39;utilisation de la PILE de l&#39;émulateur PROCSI ######\n&quot;</span>);
<a name="l00043"></a>00043 
<a name="l00044"></a>00044         printf(<span class="stringliteral">&quot;\t --&gt;Chargement du programme\n&quot;</span>);
<a name="l00045"></a>00045 
<a name="l00046"></a>00046         <a class="code" href="parser_8c.html#a77e7225758aa19ce6f3e9d4be4e8c229">load_program</a>(<span class="stringliteral">&quot;pop.procsi&quot;</span>, pvm);
<a name="l00047"></a>00047 
<a name="l00048"></a>00048         i =1;
<a name="l00049"></a>00049         <span class="keywordflow">do</span> {
<a name="l00050"></a>00050                 printf(<span class="stringliteral">&quot;\nÉxécution de l&#39;instruction n°%d\n&quot;</span>, i);
<a name="l00051"></a>00051                 i++;
<a name="l00052"></a>00052         } <span class="keywordflow">while</span>(<a class="code" href="pvm_8c.html#ade2f21f7767ed25174ef94e84548edbe">step</a>(pvm));
<a name="l00053"></a>00053 
<a name="l00054"></a>00054         printf(<span class="stringliteral">&quot;\n\nAppuyez sur une touche pour continuer.. \n&quot;</span>);
<a name="l00055"></a>00055         getchar();
<a name="l00056"></a>00056 
<a name="l00057"></a>00057         printf(<span class="stringliteral">&quot;\n\n###### Initialisation de la machine virtuelle ######\n&quot;</span>);
<a name="l00058"></a>00058 
<a name="l00059"></a>00059         pvm = <a class="code" href="pvm_8c.html#a1b0875fb61cdafebccde8bebcb6d8f0f">newPVM</a>();
<a name="l00060"></a>00060 
<a name="l00061"></a>00061         printf(<span class="stringliteral">&quot;\n###### Programme de test des fonctionnalités de décalage binaire de l&#39;émulateur PROCSI ######\n&quot;</span>);
<a name="l00062"></a>00062 
<a name="l00063"></a>00063         printf(<span class="stringliteral">&quot;\t --&gt;Chargement du programme\n&quot;</span>);
<a name="l00064"></a>00064 
<a name="l00065"></a>00065         <a class="code" href="parser_8c.html#a77e7225758aa19ce6f3e9d4be4e8c229">load_program</a>(<span class="stringliteral">&quot;decal.procsi&quot;</span>, pvm);
<a name="l00066"></a>00066 
<a name="l00067"></a>00067         i =1;
<a name="l00068"></a>00068         <span class="keywordflow">do</span> {
<a name="l00069"></a>00069                 printf(<span class="stringliteral">&quot;\nÉxécution de l&#39;instruction n°%d\n&quot;</span>, i);
<a name="l00070"></a>00070                 i++;
<a name="l00071"></a>00071         } <span class="keywordflow">while</span>(<a class="code" href="pvm_8c.html#ade2f21f7767ed25174ef94e84548edbe">step</a>(pvm));
<a name="l00072"></a>00072 
<a name="l00073"></a>00073         printf(<span class="stringliteral">&quot;\n\nAppuyez sur une touche pour continuer.. \n&quot;</span>);
<a name="l00074"></a>00074         getchar();
<a name="l00075"></a>00075 
<a name="l00076"></a>00076         printf(<span class="stringliteral">&quot;\n\n###### Initialisation de la machine virtuelle ######\n&quot;</span>);
<a name="l00077"></a>00077 
<a name="l00078"></a>00078         pvm = <a class="code" href="pvm_8c.html#a1b0875fb61cdafebccde8bebcb6d8f0f">newPVM</a>();
<a name="l00079"></a>00079 
<a name="l00080"></a>00080         printf(<span class="stringliteral">&quot;\n###### Programme de test des fonctionnalités de sauts avec étiquettes ######\n&quot;</span>);
<a name="l00081"></a>00081 
<a name="l00082"></a>00082         printf(<span class="stringliteral">&quot;\t --&gt;Chargement du programme\n&quot;</span>);
<a name="l00083"></a>00083 
<a name="l00084"></a>00084         <a class="code" href="parser_8c.html#a77e7225758aa19ce6f3e9d4be4e8c229">load_program</a>(<span class="stringliteral">&quot;jump.procsi&quot;</span>, pvm);
<a name="l00085"></a>00085 
<a name="l00086"></a>00086         i =1;
<a name="l00087"></a>00087         <span class="keywordflow">do</span> {
<a name="l00088"></a>00088                 printf(<span class="stringliteral">&quot;\nÉxécution de l&#39;instruction n°%d\n&quot;</span>, i);
<a name="l00089"></a>00089                 i++;
<a name="l00090"></a>00090         } <span class="keywordflow">while</span>(<a class="code" href="pvm_8c.html#ade2f21f7767ed25174ef94e84548edbe">step</a>(pvm));
<a name="l00091"></a>00091 
<a name="l00092"></a>00092         printf(<span class="stringliteral">&quot;\n\nAppuyez sur une touche pour continuer.. \n&quot;</span>);
<a name="l00093"></a>00093         getchar();
<a name="l00094"></a>00094 
<a name="l00095"></a>00095         printf(<span class="stringliteral">&quot;\n\n###### Initialisation de la machine virtuelle ######\n&quot;</span>);
<a name="l00096"></a>00096 
<a name="l00097"></a>00097         pvm = <a class="code" href="pvm_8c.html#a1b0875fb61cdafebccde8bebcb6d8f0f">newPVM</a>();
<a name="l00098"></a>00098 
<a name="l00099"></a>00099         printf(<span class="stringliteral">&quot;\n###### Programme de test des fonctionnalités des commandes logiques : AND, OR. ######\n&quot;</span>);
<a name="l00100"></a>00100 
<a name="l00101"></a>00101         printf(<span class="stringliteral">&quot;\t --&gt;Chargement du programme\n&quot;</span>);
<a name="l00102"></a>00102 
<a name="l00103"></a>00103         <a class="code" href="parser_8c.html#a77e7225758aa19ce6f3e9d4be4e8c229">load_program</a>(<span class="stringliteral">&quot;logic.procsi&quot;</span>, pvm);
<a name="l00104"></a>00104 
<a name="l00105"></a>00105         i =1;
<a name="l00106"></a>00106         <span class="keywordflow">do</span> {
<a name="l00107"></a>00107                 printf(<span class="stringliteral">&quot;\nÉxécution de l&#39;instruction n°%d\n&quot;</span>, i);
<a name="l00108"></a>00108                 i++;
<a name="l00109"></a>00109         } <span class="keywordflow">while</span>(<a class="code" href="pvm_8c.html#ade2f21f7767ed25174ef94e84548edbe">step</a>(pvm));
<a name="l00110"></a>00110 
<a name="l00111"></a>00111         <span class="keywordflow">return</span> 0;
<a name="l00112"></a>00112 }
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>Tout</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Structures de données</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Fichiers</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Fonctions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Définition de type</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Énumérations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Valeurs énumérées</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Généré le Sat Dec 31 2011 13:00:38 pour Emulateur PROCSI par&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>
